package com.sj.thread;

public class MyThread extends Thread {

    @Override
    public void run() {
        try {
            int secondVal = 2000;
            System.out.println(Thread.currentThread().getName() + " 执行："
                    + secondVal / 1000 + "s");
            Thread.sleep(secondVal);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws InterruptedException {
        MyThread myThread = new MyThread();
        myThread.start();
        myThread.join();
        System.out.println("我想当 myThread 对象执行完毕之后我在执行");
        System.out.println("但上面代码中的 sleep 中的值应该写多少呢？");
        System.out.println("答案是：不能确定");
    }

}
